import {req_get, req_post} from './../cssdrequest';
import {OfficeDto} from "@/type/dto/OfficeDto";
import {LoginDto} from "@/type/dto/LoginDto";
import {R} from "@/type/dto/R";

export async function api_getOfficeList(userId: string) {

    const data = await req_get('/login/id_office', {id: userId});
    //转成我要的json
    console.log('data:', data);
    return JSON.parse(data) as R<OfficeDto[]>;
}

export async function api_login(userId: string, password: string, officeCode: string) {
    // console.log('send', data);
    const data = await req_post('/login/entry', {userId, password, officeCode});
    //转成我要的json
    return JSON.parse(data) as R<LoginDto>;
}